<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns bitmask of features supported</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="eventbase.free.html">« EventBase::free</a></li>
      <li style="float: right;"><a href="eventbase.getmethod.html">EventBase::getMethod »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.eventbase.html">EventBase</a></li>
    <li>Returns bitmask of features supported</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="eventbase.getfeatures" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EventBase::getFeatures</h1>
  <p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p><p class="refpurpose"><span class="refname">EventBase::getFeatures</span> &mdash; <span class="dc-title">Returns bitmask of features supported</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-eventbase.getfeatures-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>EventBase::getFeatures</strong></span>(): <span class="type">int</span></div>

  <p class="para rdfs-comment">
   Returns bitmask of features supported.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-eventbase.getfeatures-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-eventbase.getfeatures-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns integer representing a bitmask of supported features. See
   <a href="class.eventconfig.html#eventconfig.constants" class="link">EventConfig::FEATURE_* constants</a>
   .
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-eventbase.getfeatures-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-4235">
   <p><strong>示例 #1 
    <span class="function"><strong>EventBase::getFeatures()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Avoiding&nbsp;"select"&nbsp;method<br /></span><span style="color: #0000BB">$cfg&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">EventConfig</span><span style="color: #007700">();<br />if&nbsp;(</span><span style="color: #0000BB">$cfg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">avoidMethod</span><span style="color: #007700">(</span><span style="color: #DD0000">"select"</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"'select'&nbsp;method&nbsp;avoided\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$base&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">EventBase</span><span style="color: #007700">(</span><span style="color: #0000BB">$cfg</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #DD0000">"Features:\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$features&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$base</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFeatures</span><span style="color: #007700">();<br />(</span><span style="color: #0000BB">$features&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">EventConfig</span><span style="color: #007700">::</span><span style="color: #0000BB">FEATURE_ET</span><span style="color: #007700">)&nbsp;and&nbsp;print(</span><span style="color: #DD0000">"ET&nbsp;-&nbsp;edge-triggered&nbsp;IO\n"</span><span style="color: #007700">);<br />(</span><span style="color: #0000BB">$features&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">EventConfig</span><span style="color: #007700">::</span><span style="color: #0000BB">FEATURE_O1</span><span style="color: #007700">)&nbsp;and&nbsp;print(</span><span style="color: #DD0000">"O1&nbsp;-&nbsp;O(1)&nbsp;operation&nbsp;for&nbsp;adding/deletting&nbsp;events\n"</span><span style="color: #007700">);<br />(</span><span style="color: #0000BB">$features&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #0000BB">EventConfig</span><span style="color: #007700">::</span><span style="color: #0000BB">FEATURE_FDS</span><span style="color: #007700">)&nbsp;and&nbsp;print(</span><span style="color: #DD0000">"FDS&nbsp;-&nbsp;arbitrary&nbsp;file&nbsp;descriptor&nbsp;types,&nbsp;and&nbsp;not&nbsp;just&nbsp;sockets\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>
 </div>

 <div class="refsect1 seealso" id="refsect1-eventbase.getfeatures-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member">
    <span class="methodname"><a href="eventbase.getmethod.html" class="methodname" rel="rdfs-seeAlso">EventBase::getMethod()</a> - Returns event method in use</span>
   </li>
   <li class="member">
    <span class="classname"><a href="class.eventconfig.html" class="classname">EventConfig</a></span>
   </li>
  </ul>
 </div>

</div></div></div></body></html>